{% from 'bootstrap5/nav.html' import render_nav_item, render_breadcrumb_item %}
{% from 'bootstrap5/utils.html' import render_messages %}

<!DOCTYPE html>
<html lang="en">
<head>
    {{ bootstrap.load_css() }}
    {% block scripts %}
    {{ moment.include_moment() }}
    {{ moment.locale('zh-cn') }} 
    {% endblock %}
    {% block css %}
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css">
    <link rel="stylesheet" href="https://mdbcdn.b-cdn.net/wp-content/themes/mdbootstrap4/docs-app/css/dist/mdb5/standard/core.min.css">
    <link rel="canonical" href="https://mdbootstrap.com/docs/standard/navigation/tabs/" />
    {% endblock %}
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    
    <title>{% block title %}{% endblock %}</title>
    
</head>
<body>
  <div class="container">
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
        <div class="container-fluid">
          <a class="navbar-brand" href="#">Flasky博客</a>
          <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
          </button>
          <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav me-auto mb-2 mb-lg-0">
              <li class="nav-item">
                <a class="nav-link active" aria-current="page" href="{{url_for('main.index')}}">首页</a>
              </li>
              {% if current_user.is_authenticated %}
                <li class="nav-item">
                  <a class="nav-link" href="{{url_for('main.user', username=current_user.username)}}">用户页</a>
                </li>
              {% endif %}
              
              <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
                  Dropdown
                </a>
                <ul class="dropdown-menu">
                  <li><a class="dropdown-item" href="#">Action</a></li>
                  <li><a class="dropdown-item" href="#">Another action</a></li>
                  <li><hr class="dropdown-divider"></li>
                  <li><a class="dropdown-item" href="#">Something else here</a></li>
                </ul>
              </li>
              <li class="nav-item">
                <a class="nav-link disabled">Disabled</a>
              </li>
            </ul>
            
            {% if current_user.is_authenticated %}
              <div class="btn-group">
                <button type="button" class="btn btn-warning dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
                  {{ current_user.username }}
                </button>
                <ul class="dropdown-menu">
                  <li><a class="dropdown-item" href="#">修改密码</a></li>
                  <li><a class="dropdown-item" href="#">重置密码</a></li>
                  <li><a class="dropdown-item" href="#">修改电子邮件</a></li>
                  <li><hr class="dropdown-divider"></li>
                  <li><a class="dropdown-item" href="{{ url_for('auth.logout') }}">退出</a></li>
                </ul>
              </div>
            {% else %}
              <div class="col-md-3 text-end">
                <a href="{{ url_for('auth.login')}} " class="btn btn-outline-success text-white me-2" role="button">登录</a>    
                <a href=" " class="btn btn-outline-warning me-2" role="button">注册</a>  
              </div>
            {% endif %}
          </div>
        </div>
      </nav>

    <header class="p-3 bg-primary text-white">
      
        <div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
          Flasky博客
          <a href="/" class="d-flex align-items-center mb-2 mb-lg-0 text-white text-decoration-none">
            <svg class="bi me-2" width="40" height="32" role="img" aria-label="Bootstrap"><use xlink:href="#bootstrap"></use></svg>
          </a>
  
          <ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
            <li><a href="#" class="nav-link px-2 text-white">Home</a></li>
            <li><a href="#" class="nav-link px-2 text-white">Features</a></li>
            <li><a href="#" class="nav-link px-2 text-white">Pricing</a></li>
            <li><a href="#" class="nav-link px-2 text-white">FAQs</a></li>
            <li><a href="#" class="nav-link px-2 text-white">About</a></li>
          </ul>
  
          <form class="col-12 col-lg-auto mb-3 mb-lg-0 me-lg-3">
            <input type="search" class="form-control form-control-dark" placeholder="Search..." aria-label="Search">
          </form>
  
          {% if current_user.is_authenticated %}
            <div class="btn-group">
              <button type="button" class="btn btn-warning dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
                {{ current_user.username }}
              </button>
              <ul class="dropdown-menu">
                <li><a class="dropdown-item" href="#">修改密码</a></li>
                <li><a class="dropdown-item" href="#">重置密码</a></li>
                <li><a class="dropdown-item" href="#">修改电子邮件</a></li>
                <li><hr class="dropdown-divider"></li>
                <li><a class="dropdown-item" href="{{ url_for('auth.logout') }}">退出</a></li>
              </ul>
            </div>
          {% else %}
            <div class="col-md-3 text-end">
              <a href="{{ url_for('auth.login')}} " class="btn btn-outline-success text-white me-2" role="button">登录</a>    
              <a href=" " class="btn btn-outline-warning me-2" role="button">注册</a>  
            </div>
          {% endif %}
        </div>
      
    </header>
    
      <header class="d-flex flex-wrap align-items-center justify-content-center justify-content-md-between py-3 mb-4 border-bottom">
        <a href="/" class="d-flex align-items-center col-md-3 mb-2 mb-md-0 text-dark text-decoration-none">
          <svg class="bi me-2" width="40" height="32" role="img" aria-label="Bootstrap"><use xlink:href="#bootstrap"></use></svg>
        </a>
  
        <ul class="nav col-12 col-md-auto mb-2 justify-content-center mb-md-0">
          <li><a href="{{ url_for('main.index') }}" class="nav-link px-2 link-secondary">Home</a></li>
          <li><a href="#" class="nav-link px-2 link-dark">Features</a></li>
          <li><a href="#" class="nav-link px-2 link-dark">Pricing</a></li>
          <li><a href="#" class="nav-link px-2 link-dark">FAQs</a></li>
          <li><a href="#" class="nav-link px-2 link-dark">About</a></li>
        </ul>
        
        {% if current_user.is_authenticated %}
        <div class="btn-group">
          <button type="button" class="btn btn-warning dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
            {{ current_user.username }}
          </button>
          <ul class="dropdown-menu">
            <li><a class="dropdown-item" href="#">Action</a></li>
            <li><a class="dropdown-item" href="#">Another action</a></li>
            <li><a class="dropdown-item" href="#">Something else here</a></li>
            <li><hr class="dropdown-divider"></li>
            <li><a class="dropdown-item" href="{{ url_for('auth.logout') }}">退出</a></li>
          </ul>
        </div>
        {% else %}
        <div class="col-md-3 text-end">
          <a href="{{ url_for('auth.login')}} " class="btn btn-outline-primary me-2" role="button">登录</a>    
          <a href="{{ url_for('auth.register')}} " class="btn btn-outline-warning me-2" role="button">注册</a>  
        </div>
        {% endif %}
      </header>
      {{ render_messages(container=False, dismissible=True, dismiss_animate=True) }}
      {% block page_content %}

      {% endblock %}
  </div>
      

    {{ bootstrap.load_js() }}

</body>
</html>